var root=ui("$");
var nf = sm("do_Notification");
var do_Page = sm("do_Page");
var qqHttp = require("helper/http");
var openHelper = require("helper/open");
var userUtil = require("helper/user");
var common = require("common");
var qqmath = require("util/qqmath");
var do_ALayout_3 = ui("do_ALayout_3");
var do_ALayout_2 = ui("do_ALayout_2");
var mallUrl = require("url/mall");
var priceLabel = ui("priceLabel");
var unitLabel = ui("unitLabel");
var saleCount = ui("saleCount");
//设置数据绑定的映射关系
root.setMapping({
	"img.source":"img",
	"name.text":"name",
	"priceLabel.text":"price",
	"unitLabel.text":"unit",
	"do_ALayout_3.tag" :"id",
	"name.tag" : "status",
	"cartImg.tag" : "stock",
	"saleCount.tag": "saleCount"
});

root.on("dataRefreshed", function(){
	priceLabel.text = qqmath.getDight(priceLabel.text,2)+"";
	saleCount.text = "已售" + saleCount.tag;
});

do_ALayout_3.on("touch", function(){
	openHelper.open("source://view/mall/product/main.ui",{id:do_ALayout_3.tag},"","pay_product_back");
});

do_ALayout_2.on("touch", function(data) {
	openHelper.open("source://view/mall/product/main.ui",{id:do_ALayout_3.tag},"","pay_product_back");
});